function getRootPath(){
    //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
    var pathName=window.document.location.pathname;
    //获取当前访问的根目录
    var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
    return projectName;
}
function get_random(){
	var d = new Date();
	var str = '';
	str += d.getFullYear();
 	str  += d.getMonth() + 1;
 	str  += d.getDate();
 	str += d.getHours(); 
 	str  += d.getMinutes(); 
	str+= d.getSeconds(); 
    var suijishu =	(parseInt(1000*Math.random())).toString();
   	var results = str+suijishu;
	return results;

}
function setUrl(exeid, params) {
	var str = exeid;
	for ( var key in params) {
		str += "&" + key + "=" + params[key];
	}
	return getRootPath()+"/base/comn-query.json?exeid=" + str+"&id="+get_random();
}
function setXmlUrl(exeid, params) {
	var str = exeid;
	for ( var key in params) {
		str += "&" + key + "=" + encodeURI(encodeURI(params[key]));
	}
	return getRootPath()+"/getResultData.json?exeid=" + str+"&id="+get_random();
}

function go_plugin() {
	if($B.type == "edge") return;		//不支持 edge
	if($B.type == "ie") return;			//支持 IE
	if($B.npapi || $B.ppapi) return;	//chrome 或 firefox 插件已经安装了
	if($B.type == "chrome") {
    	if($B.chrome_install_apitype == "npapi")
    		window.open(getRootPath()+"/js/binary/install_chrome.htm");
		else {
			var ofrm=document.getElementById('frm');
			ofrm.height=700;
			ofrm.contentWindow.location.href = 'http://www.supcan.cn/download/clientinstall.htm?108';
			olbl.innerHTML='下载 Chrome 浏览器插件安装包';
		}
	}
	else	//firefox
		window.open(getRootPath()+"/js/binary/supcan.xpi");
}
function OnEvent(){
	
}
function OnReady(){

}
